package cn.itsource.controller;

import domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/findOne/{id}")
    public User findOne(@PathVariable("id")Long id){
        return new User(id, "ys port=" + port, 1);
    }

    @GetMapping("/sendSms")
    public String sendSms(){
        return "我要开始发送短信啦";
    }

    @GetMapping("/sendEmail")
    public String sendEmail(){
        return "我要开始发送邮件啦";
    }
}
